#-*-coding:utf-8-*-


class OffiAcco():
    appid = "wxae665dcf8fe8ad28"#"wx49df78bfebaa167f"  # 公众号id
    secret = "c0d2fbc6e183b2299d2883e6d63df86b"#"8c10a15a256b06b1b6ae4f64bb497ce5"  # 公众号secret
    # 微信获取openid接口
    main_url = "https://api.weixin.qq.com/sns/oauth2/access_token"#?appid=%s&secret=%s&code=%s&grant_type=authorization_code
    # 允许获取openid的地址
    permit_url = [
        "http://weixin.l.ncuhome.cn:5050/cet",
        "http://weixin.l.ncuhome.cn:5050/elec"
    ]


def addopenid(url, openid):
    '''将openid接到url上'''
    if "?" in url:
        redi_url = url + "&openid=" + openid
    else:
        redi_url = url + "?openid=" + openid
    return redi_url
